STEP 6: Time to add our first if statement! We want to test if rand_answer's value is equal to 1!

  • In LOGIC, click on and drag out if. Drop it at the bottom of your program.
  • Change the test variable from choice to rand_answer.
  • Change the test value from the string "yes" to the integer 1.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)